package com.num2.controller.lkw;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.num2.form.lkw.Withdraw_Money;
import com.num2.service.lkw.WithdrawService;

@Controller
public class WithdrawCtrl {
	@Resource
	private WithdrawService withdrawservice;
	@RequestMapping("/withdraw")
	public String withdrawMoney(Withdraw_Money wm,HttpSession session,Model m){
			
			boolean result = withdrawservice.deleteMoney(wm,session);
			if(result){
				m.addAttribute("succinfo","取款成功!");
				return "demo/withdraw";
			}else{
				m.addAttribute("errorinfo","取款失败!余额不足或输入金额格式不对!");
				return "demo/withdraw";
			}
		}
	public WithdrawService getWithdrawservice() {
		return withdrawservice;
	}
	public void setWithdrawservice(WithdrawService withdrawservice) {
		this.withdrawservice = withdrawservice;
	}

	
	
}
